#include <iostream>
#include <cstring>
#include <map>
using namespace std;
int n;
const int sn = 29;
string s[sn] = {"NOIp#PJ#I#","NOIp#PJ#II#","NOIp#PJ#III#","NOIp#PJ#J#","NOIp#TG#I#","NOIp#TG#II#","NOIp#TG#III#","NOIp#TG#J#",
                "NOI#Au#","NOI#Ag#","NOI#Cu#","NOI#Xp#",
                "CTSC#Au#","CTSC#Ag#","CTSC#Cu#","CTSC#Xp#",
                "APIO#C#Au#","APIO#C#Ag#","APIO#C#Cu#",
                "APIO#A#Au#","APIO#A#Ag#","APIO#A#Cu#",
                "IOI#Au#","IOI#Ag#","IOI#Cu#",
                "UOI#Au#","UOI#Ag#","UOI#Cu#","UOI#Xp#"};
map<string,int> m;
int other = 0;

int main()
{
    for(int i = 0; i < sn; i ++)
        m[s[i]] = 1;

    cin >> n;
    cin.get();
    for(int i = 0; i < n; i ++)
    {
        string str;
        getline(cin,str,'\n');
        if(m[str] != 0)
            m[str] ++;
        else
            other ++;
    }

    for(int i = 0; i < sn; i ++)
        cout << s[i] << ":" << m[s[i]] - 1 << endl;
    cout << "other:" << other << endl;

    return 0;
}
